<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="All Rights Reserved, Copyright (C) 2013, Wuyeguo, Ltd." />
<title>我的专区</title>
<link rel="stylesheet" type="text/css" href="easyui/1.3.4/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="css/wu.css" />
<link rel="stylesheet" type="text/css" href="css/icon.css" />
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="easyui/1.3.4/jquery.easyui.min.js"></script>
<script type="text/javascript" src="easyui/1.3.4/locale/easyui-lang-zh_CN.js"></script>
</head>
<body>
<script type="text/javascript">
	$("#ff").form({
		url : '/mw/WorkerAction?method=add',
		onSubmit : function() {
			return $("#ff").form('validate')
		},
		success : function(data) {
			alert(data)
		}
	});
</script>
<div class="easyui-panel" title="添加员工" data-options="fit:true" >
	<div style="padding:10px;text-align: center;">
		<form id="ff" method="post" autocomplete="off" action="/mw/WorkerAction?method=add">
			<table style="border: 1px solid #000;padding: 10px 20px;margin: 0 auto;">
				<tr>
					<td>姓名:</td>
					<td><input class="easyui-validatebox" type="text" name="name"
						data-options=""></input></td>

					<td>部门:</td>
					<td><input class="easyui-validatebox" type="text"
						name="department" data-options=""></input></td>
				</tr>
				<tr>
					<td>职位:</td>
					<td><input class="easyui-validatebox" type="text"
						name="role" data-options=""></input></td>
					<td>工号:</td>
					<td><input class="easyui-validatebox" type="text"
						name="number" data-options=""></input></td>
				</tr>
				<tr>
					<td>入职时间:</td>
					<td>
						<input name="entryDate" type="text" class="easyui-datebox"></input>  
					</td>
					<td>离职时间:</td>
					<td>
						<input  name="leaveDate"   type="text" class="easyui-datebox"></input>  
					</td>
				</tr>
				
				<tr>
					<td>身份证:</td>
					<td><input class="easyui-validatebox" type="text"
						name="idcard" data-options=""></input></td>
					<td>身份证有效期:</td>
					<td>
						<input name="validDate" type="text" class="easyui-datebox"></input>
					</td>
				</tr>
				
				<tr>
					<td>性别:</td>
					<td>
						<select class="" name="gender" style="width:100%;">  
							<option selected="selected" disabled="disabled"  style='display: none' value=''></option>  
						    <option value="男">男</option>  
						    <option value="女">女</option>
						</select>
					</td>
					<td>出生日期:</td>
					<td>
						<input name="birthday" type="text" class="easyui-datebox"></input>
					</td>
				</tr>
				
				
				
				<tr>
					<td>民族:</td>
					<td><input class="easyui-validatebox" type="text"
						name="nation" data-options=""></input></td>
					<td>联系电话:</td>
					<td>
						<input class="easyui-validatebox" type="text" name="telephone" data-options=""></input>
					</td>
				</tr>
				
				<tr>
					<td>婚姻状况:</td>
					<td>
						<select class="" name="marriage" style="width:100%;">  
							<option selected="selected" disabled="disabled"  style='display: none' value=''></option>  
						    <option value="已婚">已婚</option>  
						    <option value="未婚">未婚</option>  
						    <option value="离异">离异</option>
						</select>  
					</td>
					<td>最高学历:</td>
					<td>
						<select class="" name="education" style="width:100%;">  
							<option selected="selected" disabled="disabled"  style='display: none' value=''></option>  
						    <option value="初中及以下">初中及以下</option>  
						    <option value="高中或中专">高中或中专</option>  
						    <option value="本科或专科">本科或专科</option>
						    <option value="硕士或研究生">硕士或研究生</option>
						    <option value="博士及以上">博士及以上</option>
						</select>  
					</td>
				</tr>
				
				<tr>
					<td>所学专业:</td>
					<td><input class="easyui-validatebox" type="text"
						name="major" data-options=""></input></td>
					<td>毕业学校:</td>
					<td>
						<input class="easyui-validatebox" type="text"
						name="graduation" data-options=""></input>
					</td>
				</tr>
				
				<tr>
					<td>合同名称:</td>
					<td><input class="easyui-validatebox" type="text"
						name="contract" data-options=""></input></td>
					<td>工作状态:</td>
					<td>
						<select class="" name="education" style="width:100%;">  
							<option selected="selected" disabled="disabled"  style='display: none' value=''></option>  
						    <option value="初中及以下">初中及以下</option>  
						    <option value="高中或中专">高中或中专</option>  
						    <option value="本科或专科">本科或专科</option>
						    <option value="硕士或研究生">硕士或研究生</option>
						    <option value="博士及以上">博士及以上</option>
						</select>  
					</td>
				</tr>
				<tr>
					<td>合同到期日期:</td>
					<td>
						<input name="conValidDate" type="text" class="easyui-datebox"></input>
					</td>
					<td>合同生效日期:</td>
					<td>
						<input name="conInvalidDate" type="text" class="easyui-datebox"></input>
					</td>
				</tr>
				
				<tr>
					<td>身份证地址:</td>
					<td colspan="3">
						<input name="address" class="easyui-validatebox" style="width: 99%" type="text" name="subject" data-options=""></input>
					</td>
				</tr>
				
				<tr>
					<td>紧急联络人:</td>
					<td>
						<input  name="linkMan" class="easyui-validatebox" type="text" name="subject" data-options=""></input>
					</td>
					<td>紧急联络电话:</td>
					<td>
						<input name="linkTel" class="easyui-validatebox" type="text" name="subject" data-options=""></input>
					</td>
				</tr>
				
				
				
				<tr style="text-align: center;">
					<td colspan="2"><a href="javascript:void(0)" style="margin-top: 20px;"
						class="easyui-linkbutton" onclick="javascript:submit();">提交</a></td>
					<td colspan="2"><a href="javascript:void(0)" style="margin-top: 20px;"
						class="easyui-linkbutton" onclick="javascript:clearForm();">重置</a></td>
				</tr>
			</table>
		</form>
	</div>
</div>
<script type="text/javascript">
function submit() { 
      $('#ff').form('submit', { 
        url: "/mw/WorkerAction?method=add", 
        onSubmit: function () {        //表单提交前的回调函数 
          var isValid = $(this).form('validate');//验证表单中的一些控件的值是否填写正确，比如某些文本框中的内容必须是数字 
          if (!isValid) { 
          } 
          return isValid; // 如果验证不通过，返回false终止表单提交 
        }, 
        success: function (data) {  //表单提交成功后的回调函数，里面参数data是我们调用/BasicClass/ModifyClassInfo方法的返回值。 
        	$.messager.alert('提示','添加成功');  
        	clearForm();
        } 
      }); 
} 
function clearForm() {
		$('#ff').form('clear');
}

</script>
</body>
</html>